$(function(){
	var homeBaseUrl = ''
	homeBaseUrl = HOME.getQueryVariable('type') == 1 ? HOME.baseUrl.classify : HOME.baseUrl.classify_line

	HOME.ajaxHOMEFn({
    url: homeBaseUrl,
    type: 'GET',
    dataType: 'json',
    data: {
        id : HOME.getQueryVariable('id')
    }
	}, function (res) {
		for(var i=0;i<res.length;i++){
			res[i].type = HOME.getQueryVariable('type')
			res[i].curId = HOME.getQueryVariable('curId')
		}
	    $('#table').html(template('tableTpl', {'res': res}));
        var windowHeight = $(window).height();
        var mainWrapHeight = $('.free_box').height();
        if(mainWrapHeight < windowHeight - 170){
            $('.free_box').height(windowHeight - 277 + 'px');
        }
	})
   
})